package at.jaki.ubb.crawling.model;

import java.util.Collection;
import java.util.Collections;

/**
 * 
 * @author Attila Jakabfi
 * 
 * @param <D> Generic type of the returned data
 * @param <T> Generic type of the return targets
 */
public class DataFinderResult<D, T> {

	private Collection<RawData<D>> rawDataCollection = Collections.emptyList();
	private Collection<Target<T>> targetCollection = Collections.emptyList();

	public DataFinderResult(Collection<RawData<D>> rawDataCollection, Collection<Target<T>> targetCollection) {
		super();
		setRawDataCollection(rawDataCollection);
		setTargetCollection(targetCollection);
	}

	public final Collection<RawData<D>> getRawDataCollection() {
		return rawDataCollection;
	}

	public final Collection<Target<T>> getTargetCollection() {
		return targetCollection;
	}

	/**
	 * make sure that null can't be set
	 * 
	 * @param rawDataCollection
	 */
	private void setRawDataCollection(Collection<RawData<D>> rawDataCollection) {
		if (rawDataCollection != null) {
			this.rawDataCollection = rawDataCollection;
		}
	}

	/**
	 * make sure that null can't be set
	 * 
	 * @param targetCollection
	 */
	private void setTargetCollection(Collection<Target<T>> targetCollection) {
		if (targetCollection != null) {
			this.targetCollection = targetCollection;
		}
	}

}
